package top.leyi.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import top.leyi.entity.Job;
import top.leyi.entity.SQLUtil;

import java.util.List;

public interface JobMapper {

    /**
     * @desc 查询所有的job
     * @return
     */
    @Select("select * from job where is_delete = 0  ORDER BY ID DESC   LIMIT #{limit} OFFSET #{offset}")
    public List<Job> queryAllJob(SQLUtil sqlUtil);


    /**
     * @desc 添加job
     */
    @Insert("INSERT INTO job(name,details,phone,pics) VALUES(#{name},#{details},#{phone},#{pics})")
    public void addJob(Job job);

    /**
     * @desc 删除job
     */
    @Delete("update job set is_delete = 1 where id = #{value}")
    public void deleteJob(int jobId);


}
